/**
 * 
 */
package de.rotkiv.common.filetools;

import static org.junit.Assert.*;

import java.io.File;

import org.junit.Test;

/**
 * @author Viktor
 *
 */
public class ToolBoxFileTest {


	@Test
	public void testQuelleLaenger() {
		File quelle 	= new File("D:\\MP3-Test\\Input-Test\\Musik\\DE\\Interpret1\\CD2\\Interpret1-CD2-Track1.mp3");
		File ziel   	= new File("D:\\MP3-Test\\Output MediaPlayer\\Interpret1\\CD2\\Interpret1-CD2-Track1.mp3");
		String actual 	= ToolBoxFile.getRelativePath(quelle, ziel);
		assertEquals("..\\..\\..\\..\\..\\Output MediaPlayer\\Interpret1\\CD2\\Interpret1-CD2-Track1.mp3", actual);
	}

	@Test
	public void testZielLaenger() {
		File quelle 	= new File("D:\\Interpret1-CD2-Track1.mp3");
		File ziel   	= new File("D:\\MP3-Test\\Output MediaPlayer\\Interpret1\\CD2\\Interpret1-CD2-Track1.mp3");
		String actual 	= ToolBoxFile.getRelativePath(quelle, ziel);
		assertEquals("MP3-Test\\Output MediaPlayer\\Interpret1\\CD2\\Interpret1-CD2-Track1.mp3", actual);
	}
	
	@Test
	public void testOhneUeberlappung() {
		File quelle 	= new File("C:\\MP3-Test\\Input-Test\\Musik\\DE\\Interpret1\\CD2\\Interpret1-CD2-Track1.mp3");
		File ziel   	= new File("D:\\MP3-Test\\Output MediaPlayer\\Interpret1\\CD2\\Interpret1-CD2-Track1.mp3");
		String actual 	= ToolBoxFile.getRelativePath(quelle, ziel);
		assertEquals("..\\..\\..\\..\\..\\..\\..\\D:\\MP3-Test\\Output MediaPlayer\\Interpret1\\CD2\\Interpret1-CD2-Track1.mp3", actual);
	}

}
